3.3.3 \(\int \frac {(c+d x)^2}{x (a+b x)} \, dx\)

Optimal. Leaf size=42 \[ -\frac {(b c-a d)^2 \log (a+b x)}{a b^2}+\frac {c^2 \log (x)}{a}+\frac {d^2 x}{b} \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {72} \begin {gather*} -\frac {(b c-a d)^2 \log (a+b x)}{a b^2}+\frac {c^2 \log (x)}{a}+\frac {d^2 x}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2/(x*(a + b*x)),x]

[Out]

(d^2*x)/b + (c^2*Log[x])/a - ((b*c - a*d)^2*Log[a + b*x])/(a*b^2)

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {(c+d x)^2}{x (a+b x)} \, dx &=\int \left (\frac {d^2}{b}+\frac {c^2}{a x}-\frac {(-b c+a d)^2}{a b (a+b x)}\right ) \, dx\\ &=\frac {d^2 x}{b}+\frac {c^2 \log (x)}{a}-\frac {(b c-a d)^2 \log (a+b x)}{a b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 42, normalized size = 1.00 \begin {gather*} \frac {-(b c-a d)^2 \log (a+b x)+a b d^2 x+b^2 c^2 \log (x)}{a b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2/(x*(a + b*x)),x]

[Out]

(a*b*d^2*x + b^2*c^2*Log[x] - (b*c - a*d)^2*Log[a + b*x])/(a*b^2)

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(c+d x)^2}{x (a+b x)} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(c + d*x)^2/(x*(a + b*x)),x]

[Out]

IntegrateAlgebraic[(c + d*x)^2/(x*(a + b*x)), x]

________________________________________________________________________________________

fricas [A]  time = 1.36, size = 53, normalized size = 1.26 \begin {gather*} \frac {a b d^{2} x + b^{2} c^{2} \log \relax (x) - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x + a\right )}{a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x/(b*x+a),x, algorithm="fricas")

[Out]

(a*b*d^2*x + b^2*c^2*log(x) - (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(b*x + a))/(a*b^2)

________________________________________________________________________________________

giac [A]  time = 1.11, size = 55, normalized size = 1.31 \begin {gather*} \frac {d^{2} x}{b} + \frac {c^{2} \log \left ({\left | x \right |}\right )}{a} - \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x/(b*x+a),x, algorithm="giac")

[Out]

d^2*x/b + c^2*log(abs(x))/a - (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(abs(b*x + a))/(a*b^2)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 61, normalized size = 1.45 \begin {gather*} -\frac {a \,d^{2} \ln \left (b x +a \right )}{b^{2}}+\frac {c^{2} \ln \relax (x )}{a}-\frac {c^{2} \ln \left (b x +a \right )}{a}+\frac {2 c d \ln \left (b x +a \right )}{b}+\frac {d^{2} x}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2/x/(b*x+a),x)

[Out]

d^2*x/b+c^2*ln(x)/a-a/b^2*ln(b*x+a)*d^2+2/b*ln(b*x+a)*c*d-1/a*ln(b*x+a)*c^2

________________________________________________________________________________________

maxima [A]  time = 1.06, size = 53, normalized size = 1.26 \begin {gather*} \frac {d^{2} x}{b} + \frac {c^{2} \log \relax (x)}{a} - \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x + a\right )}{a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x/(b*x+a),x, algorithm="maxima")

[Out]

d^2*x/b + c^2*log(x)/a - (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(b*x + a)/(a*b^2)

________________________________________________________________________________________

mupad [B]  time = 0.39, size = 49, normalized size = 1.17 \begin {gather*} \frac {d^2\,x}{b}-\ln \left (a+b\,x\right )\,\left (\frac {c^2}{a}+\frac {a\,d^2}{b^2}-\frac {2\,c\,d}{b}\right )+\frac {c^2\,\ln \relax (x)}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^2/(x*(a + b*x)),x)

[Out]

(d^2*x)/b - log(a + b*x)*(c^2/a + (a*d^2)/b^2 - (2*c*d)/b) + (c^2*log(x))/a

________________________________________________________________________________________

sympy [B]  time = 0.98, size = 73, normalized size = 1.74 \begin {gather*} \frac {d^{2} x}{b} + \frac {c^{2} \log {\relax (x )}}{a} - \frac {\left (a d - b c\right )^{2} \log {\left (x + \frac {a b c^{2} + \frac {a \left (a d - b c\right )^{2}}{b}}{a^{2} d^{2} - 2 a b c d + 2 b^{2} c^{2}} \right )}}{a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2/x/(b*x+a),x)

[Out]

d**2*x/b + c**2*log(x)/a - (a*d - b*c)**2*log(x + (a*b*c**2 + a*(a*d - b*c)**2/b)/(a**2*d**2 - 2*a*b*c*d + 2*b
**2*c**2))/(a*b**2)

________________________________________________________________________________________